<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>基础信息</title>
    <link href="../lib/layui/css/layui.css" rel="stylesheet" type="text/css" media="screen"/>
    <script src="../lib/jquery-3.3.1.min.js" type="text/javascript"></script>
    <script src="../lib/layui/layui.js" type="text/javascript"></script>
    <script>
        layui.use(['form'], function(){
            var form = layui.form;
            $.get('/acsCommunity/listCommunities', {}, function (result) {
                if(result != null){
                    if(result.resultContent != null){
                        var a$opt_html = "";
                        $.each(result.resultContent, function (index, item) {
                            a$opt_html += "<option id='" + item.CODE + "' value='" + item.ID + "'>" + item.NAME + "</option>";
                            $("#community").empty().append(a$opt_html);
                            form.render('select');
                        });

                    }
                }
            });
            form.on('select(community)', function(data){
                $("#Iframe").contents().find("#reloadBlock").click(); //楼栋
                $("#Iframe").contents().find("#reloadRoom").click(); //房间
                $("#Iframe").contents().find("#reloadUser").click(); //人员
            });
        });
        layui.use('element');
        function changeIframe(srcData) {
            // $("#Iframe").attr("src","/web/cdacsrecord"+srcData);
            $("#Iframe").attr("src", srcData); //本地开发测试使用
        }
        function reloadPage() {
            location.reload();
        }
    </script>
</head>
<body class="layui-layout-body" style="background-color: white">
<div class="layui-inline" style="float: right;margin-right: 10px;z-index: 2">
    <button style="display: none" id="reload" onclick="reloadPage()"></button>
    <form class="layui-form">
        <label >所属小区</label>
        <div class="layui-input-inline">
            <select name="community" id="community" lay-filter="community" >
            </select>
        </div>
    </form>
</div>
<div class="layui-layout layui-layout-admin">
    <div  >
        <ul class="layui-tab-title">
            <li class="layui-this" onclick="changeIframe('/basicinfo/basicCommunity.html')">小区信息</li>
            <li onclick="changeIframe('/basicinfo/basicBlock.html')">楼栋信息</li>
            <li onclick="changeIframe('/basicinfo/basicRoom.html')">房间信息</li>
            <li onclick="changeIframe('/basicinfo/basicUser.html')">业主信息</li>
<!--            <li onclick="changeIframe('/basicinfo/basicType.html')"> 访客访问方式</li>-->
<!--            <li onclick="changeIframe('/basicinfo/basicSysInfo.html')"> 系统信息</li>-->
        </ul>
        <div class="layui-tab-content"  >
<!--            <iframe id="Iframe" class='layui-col-xs12' style="border: none; height: 600px;" src="/web/cdacsrecord/basicinfo/basicCommunity.html"></iframe>-->
            <!-- 本地开发测试使用 -->
            <iframe id="Iframe" name="iframe" class='layui-col-xs12' style="border: none; height: 600px;" src="/basicinfo/basicCommunity.html"></iframe>
        </div>
    </div>

</div>

</body>
